const Cesium = window.Cesium;
import { formarColor, COLOR } from '../../Config'

class Point {
    constructor(Entity, selectColor, size) {
        if (!Entity) {
            throw new Error('至少传入一个 Entity 对象');
        }
        var FontSize = window.REMFontSize || 1;
        this.selectColor = formarColor(selectColor) || COLOR.DEFAULT
        var PointOptions = {
            show: false, //是否展示
            pixelSize: size || parseInt(32 * FontSize), //点的大小
            color: Cesium.Color.YELLOW.withAlpha(0), //颜色
            outline: true,
            outlineWidth: 2,
            outlineColor: this.selectColor,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
        };
        Entity.point = PointOptions;
        this.Entity = Entity;
    }
    set Select(type) {
        this.Entity.point.show = !!type;
    }
    get Select() {
        return this.Entity.point.show;
    }
    destroy() {
        this.Entity.point = null;
    }
}


export { Point }
